import main

if __name__ == '__main__':
    school = input('请输入学校名称')
    username = input('请输入用户名')
    password = input('请输入密码')
    i =  int(input('请选择模式：\n1.抢课\n2.查询当天活动:'))
    if i == 1:
        actn = input('请输入活动名称')
        x = main.Second_classroom(school=school, username=username, password=password)
        x.open_web()
        x.signin()
        x.search_act(actname=actn)
        x.enroll_act()
    elif i == 2:
        x = main.Second_classroom(school=school, username=username, password=password)
        x.open_web()
        x.signin()
        try:
            x.list_act()
            print('成功')
        except:
            print('失败')